package com.liuyuan.controller;

import com.liuyuan.pojo.News;
import com.liuyuan.pojo.User;
import com.liuyuan.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/news")
public class NewsController {
    @Autowired
    private NewsService newsService;

    @RequestMapping("/getNewsById")
    public News getNewsById(int id){
        News news = newsService.getNewsById(id);
        return news;
    }

}
